const labelService = require("../service/label.service");

class LabelController {
    async create(ctx, next) {
        // 获取内容
        const { name } = ctx.request.body;
        // 2. 操作数据库，存储name
        const result = await labelService.create(name)
        ctx.body = {
            code: 0,
            message: '创建标签成功！',
            result
        }
    }

    async list(ctx, next) {
        const result = await labelService.list();
        ctx.body = {
            code: 0,
            message: '获取标签列表成功！',
            result
        }
    }


}

module.exports = new LabelController()